-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implement Create email template endpoint (Admin) #40 #75
Conversation
This reverts commit e2416f6.
src/services/admin/email.service.ts
Outdated
recipient: string, | ||
subject: string, | ||
content: string, | ||
state: EmailStatusTypes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create email template only requires the content and subject. A sent email will have the data you mentioned above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted Thanks
src/services/admin/email.service.ts
Outdated
const newEmailTemplate = new Email( | ||
'', | ||
subject, | ||
content, | ||
EmailStatusTypes.SENT | ||
) | ||
|
||
const savedEmailTemplate = await emailRepositroy.save(newEmailTemplate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check the ERD here? https://drive.google.com/file/d/11KMgdNu2mSAm0Ner8UsSPQpZJS8QNqYc/view
Email templates are saved under the platform table. The email table is used to track the email that we are sending through the platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any updates @sathudeva7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an issue on how to find platform to add the email templates in the platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have created a Platform entity. So you can use it the the same as you have used the emailRepositroy @sathudeva7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but how can we find the particular platform from db, because we didnt pass any platformId in the request query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we had a discussion regarding this. Can you create a new table to store the email templates? I will update the ERD as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! @sathudeva7
Purpose
The purpose of this PR is to fix #40
Goals
This issue involves implementing an API to create email template. The endpoint should allow Admin to make a POST request to {{baseUrl}}/api/admin/emails/templates.
Approach
Screenshots
Checklist
Related PRs
Test environment
Learning